<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
		<meta charset="UTF-8">
	<title><?php echo ('[title]' == '['.'title'.']' ? C('WEBSITE_NAME') : '[title]');?></title>
	<meta name="viewport" content="initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="red" name="apple-mobile-web-app-status-bar-style">
	<meta name="format-detection" content="telphone=no">
	<link rel="stylesheet" href="/css/mall.css?modify=2016101809">
	<link rel="stylesheet" href="/css/trade.css?modify=2016101809">
	<link rel="stylesheet" href="/css/red.css">
	<script type="text/javascript">
	var require = {
		baseUrl: '/js',
		waitSeconds: 0,
		map: {
		  '*': {
			'css': '//cdn.bootcss.com/require-css/0.1.8/css.min.js',
			'text': '//cdn.bootcss.com/require-text/2.0.12/text.min.js'
		  }
		},
		shim: {
			swiper: ['jquery', 'css!//cdn.bootcss.com/Swiper/3.3.1/css/swiper.min.css'],
			lazyload: ['jquery'],
		},
		paths: {
            'jquery': '//cdn.bootcss.com/jquery/1.12.4/jquery.min',
			'template': 'template',
			'validatejs': '//cdn.bootcss.com/jquery-validate/1.15.0/jquery.validate.min',
			'weixinjs': 'https://res.wx.qq.com/open/js/jweixin-1.0.0',
			'lazyload': '//cdn.bootcss.com/jquery.lazyload/1.9.1/jquery.lazyload.min',
			'swiper': '//cdn.bootcss.com/Swiper/3.3.1/js/swiper.min',

			'mall/cart': 'h5.js?modify=2016101809',
			'view/order/list': 'h5.js?modify=2016101809',
			'view/balance': 'h5.js?modify=2016101809',
			'module/cart/num': 'h5.js?modify=2016101809',
			'order/address': 'h5.js?modify=2016101809',
			'pay': 'h5.js?modify=2016101809',
			'view/personal/edit': 'h5.js?modify=2016101809',
			'view/personal/scoreDetail': 'h5.js?modify=2016101809',
			'view/present/list': 'h5.js?modify=2016101809',
			'view/score': 'h5.js?modify=2016101809',
			'pay/express': 'h5.js?modify=2016101809',
			'jsweixin': 'h5.js?modify=2016101809',
			'skumodal': 'h5.js?modify=2016101809',
			'customer_service': 'h5.js?modify=2016101809',
			'order/refund': 'h5.js?modify=2016101809',
			'model_pay_coupon': 'h5.js?modify=2016101809',
			'login_modal': 'h5.js?modify=2016101809',
			'member/collection': 'h5.js?modify=2016101809',
            'pullfresh': 'h5.js?modify=2016101809',
            'goods_list': 'h5.js?modify=2016101809',
          	'search': 'h5.js?modify=2016101809',
		}
	}
	</script>
	<?php if(IS_APP): ?><script type="text/javascript" src="/js/appcan.min.js"></script><?php endif; ?>
	<script data-main="/js/h5.js?modify=2016101809" src="//cdn.bootcss.com/require.js/2.3.1/require.min.js"></script>
	<?php if(!APP_DEBUG){ require_once 'cs.php';echo '<img src="'._cnzzTrackPageView(1259294058).'" width="0" height="0" style="display:none;"/>'; } ?>
	<style type="text/css">
	.tobe3{margin-bottom: 56px; }
	.add-kefu{}
	.add-kefu .rule-dd{text-align: center;}
	.add-kefu .rule-dd .paragraph{text-indent: 0;}
	.add-kefu .rule-dd img{width: 80%;}
	</style>
</head>
<body>
	<div class="container rule-container">
		<div class="content">
			<img src="/img/rule/rule-header.png" style="width: 100%" alt="我要当老板">
			<ul class="rule-list">
				<li class="rule-list-item add-kefu" id="add_kefu" style="<?php echo ($agent_level==0 ? 'display:none;':''); ?>">
					<dl class="rule-dl">
						<dt class="rule-dt"><h4>现在我该怎么做？</h4></dt>
						<dd class="rule-dd">
							<p class="paragraph">长按二维码添加我们的客服，带你赚钱带你飞！</p>
							<img src="<?php echo C('KEFU.url');?>">
						</dd>
					</dl>
					<div class="diamond-line"></div>
				</li>
				<li class="rule-list-item">
					<dl class="rule-dl">
						<dt class="rule-dt"><h4>为什么做会员？</h4></dt>
						<dd class="rule-dd">
							<p class="paragraph">不用租门店，不用招员工，不用装修交保证金，你就可以轻轻松松做老板。</p>
						<p class="paragraph">省掉采购囤货烦恼，一键下单平台发货。</p>
						<p class="paragraph">只要你有能力销售商品、推广平台，就能赚到高额利润。</p>
					</dd>
					</dl>
					<div class="diamond-line"></div>
				</li>
				<li class="rule-list-item" style="display:none">
					<dl class="rule-dl">
						<dt class="rule-dt"><h4>成为会员的好处？</h4></dt>
						<dd class="rule-dd">
							<p class="paragraph">成为平台会员，您将享有中国微商界最低的价格。</p>
							<p class="paragraph" style="line-height: 1.4em;">分享你的二维码给身边的朋友，他买货，你赚积分，会员和零售价的差价都归你。他充值成为会员，你立得200积分奖励。</p> 
						</dd>
					</dl>
					<div class="diamond-line"></div>
				</li>
				<li class="rule-list-item">
					<dl class="rule-dl">
						<dt class="rule-dt"><h4>如何成为会员？</h4></dt>
						<dd class="rule-dd">
							<p class="paragraph">用户在微信公众号内充值<?php echo ($agent["once_amount"]); ?>元，即可成为<?php echo ($agent["title"]); ?>。</p>
							<p class="paragraph">*本平台只接受微信支付，如若有人联系您以微信红包、微信转账、支付宝转账等方式交易，请一律视为骗子！</p>
						</dd>
					</dl>
					<div class="diamond-line"></div>
				</li>
				<!-- 
				<li class="rule-list-item">
					<dl class="rule-dl">
						<dt class="rule-dt"><h4>推荐好友的好处？</h4></dt>
						<dd class="rule-dd">
							<p class="paragraph">  您每成功推荐一个好友，即可得到<?php echo ($agent["parent1_amount"]); ?>积分作为推荐奖励。</p> 
							<p class="paragraph" style="line-height: 1.4em;">  当您推荐的好友再推荐好友时，您作为他的2级推荐人，能获得<?php echo ($agent["parent2_amount"]); ?>积分作为间接推荐奖励。</p>
							<p class="paragraph" style="line-height: 1.4em;">  当您的间接好友再推荐好友时，您作为他的3级推荐人，还能获得<?php echo ($agent["parent3_amount"]); ?>积分作为推荐奖励。</p>
						</dd>
					</dl>
					<div class="diamond-line"></div>
				</li>
				 -->
				<li class="rule-list-item">
					<dl class="rule-dl">
						<dt class="rule-dt"><h4>如何推荐好友？</h4></dt>
						<dd class="rule-dd">
							<p class="paragraph">  在公众平台点击“推荐好友”菜单，即可获得自己专属二维码。</p>
							<p class="paragraph" style="line-height: 1.4em;">当有客户扫描您的推荐二维码，就会成功建立好友关系。</p> 
						</dd>
					</dl>
					<div class="diamond-line"></div>
				</li>
			</ul>
			<?php if($agent_level == 0): ?><div class="tobe3">
					<div class="white-round">充值<?php echo ($agent["once_amount"]); ?>元</div>
					<h2 class="headline">成为<?php echo ($agent["title"]); ?></h2>
					<!-- <img src="/img/rule/down-icon.png" alt="" style="width: 5.5%; margin-left: 47.25%"> -->
					<a id="js-btn-pay" href="javascript:void(0);" class="become3-btn"><img src="/img/rule/become3_btn.png" alt="成为三级代理"></a>
				</div><?php endif; ?>
		</div>
	</div>
	<div id="shop-nav">
	<div class="shop-nav nav-menu nav-menu-1 has-menu-3">
		<div class="nav-special-item nav-item">
			<a href="/h5/mall" class="home jump_link">主页</a>
		</div>
		<div class="nav-item">
			<a class="mainmenu js-lxkf" href="javascript:;">
				<span class="mainmenu-txt">在线客服</span>
			</a>
		</div>
	 	<div class="nav-item">
			<a href="/h5/list" class="mainmenu">
	 			<span class="mainmenu-txt">全部商品</span>
	 		</a>
		</div>
	 	<div class="nav-item">
	 		<a href="/h5/personal" class="mainmenu">
	 			<span class="mainmenu-txt">会员中心</span>
	 		</a>
	 	</div>
	</div>
    <link rel="stylesheet" href="/css/shopnav.css?modify=20160921" type="text/css" />
</div>
	<script type="text/javascript">
	require(['pay', 'jquery'], function(pay){
		var $btn_wxpay = $('#js-btn-pay');
		
		var bindPay = function(data){
			$btn_wxpay.unbind('click');
			$btn_wxpay.on('click', function(){
				pay.callpay(data, function(res){
					if(res.errcode == 0){
						paySuccess(data.tid);
					}
				});
				return false;
			}).trigger('click');
		}
		
		$btn_wxpay.on('click', function(){
			$btn_wxpay.attr('disabled', 'disabled');
			$.ajax({
				url: '/h5/pay/payagent',
				type: 'post',
				dataType: 'json',
				success: function(data){
					bindPay(data);
				},
				complete: function(){
					$btn_wxpay.removeAttr('disabled');
				}
			});
			
			return false;
		})
	});

	var user = <?php echo json_encode($user);?>;
	function editPersonal(){
		require(['view/personal/edit'], function(view){
			view.show(user, function(data){
				$.ajax({
					url: '/h5/personal/save',
					data: {data:data},
					type: 'post',
					dataType: 'json',
					success: function(){
						user = data;
					}
				});
			});
		});
	}
	
	// 支付成功
	function paySuccess(tid){
		//充值成功后发送提醒消息
		$.ajax({
			url: '/h5/pay/agetnMessage',
			data: {tid:tid},
			type: 'post'
		});

		$('.tobe3').hide();
		$('#add_kefu').show();
		$('#confirm-pay-way-opts').remove();
		alert('请完善个人资料并仔细阅读本页内容！');
		editPersonal();
	}
	</script>
</body>
</html>